<template>
    <!-- 搜索查询展示页面 -->
    <div class="content">
        <ul>
            <li v-for="item in checkList" :key="item.id">
                <div>
                    <router-link :to="{ name: 'info', query: item }">
                        <img :src="item.imgUrl" alt="" />
                    </router-link>
                </div>
                <div class="messageBox">
                    <router-link class="title" :to="{ name: 'info', query: item }">
                        {{ item.title }}
                    </router-link>
                    <p>{{ item.passage }}</p>
                    <span>作者:{{ item.author }}</span>
                    <span>{{ item.sort }}</span>
                </div>
            </li>
        </ul>
    </div>
</template>
<script setup>
import axios from "axios";
import { ref, onMounted } from "vue"
import { useRoute } from "vue-router"
const checkList = ref([])
const info = ref('')
const selctAll = axios.create(
    {
        baseURL: 'http://localhost:8000',
        timeout: 5000
    }
)

onMounted(() => {
    const route = useRoute()
    info.value = route.query.info
    selctAll.post("/selectAll", { info: info.value }).then((req) => {
        checkList.value = req.data
    })
})
</script>
<style scoped></style>